﻿String.format = function (src) {
	if (arguments.length == 0) return null;
	var args = Array.prototype.slice.call(arguments, 1);
	return src.replace(/\{(\d+)\}/g, function (m, i) {
		return args[i];
	});
};

function offset(a) {
	var b = this[0];
	if (a) return this.each(function (e) {
		c.offset.setOffset(this, a, e)
	});
	if (!b || !b.ownerDocument) return null;
	if (b === b.ownerDocument.body) return c.offset.bodyOffset(b);
	var d = b.getBoundingClientRect(), f = b.ownerDocument;
	b = f.body; f = f.documentElement;
	return { top: d.top + (self.pageYOffset || c.support.boxModel && f.scrollTop || b.scrollTop) - (f.clientTop || b.clientTop || 0),
		left: d.left + (self.pageXOffset || c.support.boxModel && f.scrollLeft || b.scrollLeft) - (f.clientLeft || b.clientLeft || 0)
	}
}